/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ez2find.model;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

/**
 *
 * @author Owner
 */
@NamedQueries(value={@NamedQuery(name="listAllHousing", query="SELECT h FROM Hous h"),
                     @NamedQuery(name="lastHousCode", query="SELECT MAX(h.code) FROM Hous h")})

@Entity
public class Hous extends Post implements Serializable{

    private String housType;
    private String amountType;
    private double amountValue;
    private String sizeType;
    private int sizeValue;
    private String address;
    //Other Stuff
    private boolean cats;
    private boolean dogs;
    //Permissions
    private boolean othersContact;
    @ManyToOne()
    private HousCategorie housCategorie;
    @OneToMany(mappedBy="hous",cascade=CascadeType.REMOVE)
    private List<Image> images;
    private boolean img;
    
    public boolean getCats() {
        return cats;
    }

    public void setCats(boolean cats) {
        this.cats = cats;
    }

    public boolean getDogs() {
        return dogs;
    }

    public void setDogs(boolean dogs) {
        this.dogs = dogs;
    }

    public boolean getOthersContact() {
        return othersContact;
    }

    public void setOthersContact(boolean othersContact) {
        this.othersContact = othersContact;
    }

    public String getSizeType() {
        return sizeType;
    }

    public void setSizeType(String sizeType) {
        this.sizeType = sizeType;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getHousType() {
        return housType;
    }

    public void setHousType(String housType) {
        this.housType = housType;
    }

    public String getAmountType() {
        return amountType;
    }

    public void setAmountType(String amountType) {
        this.amountType = amountType;
    }

    public List<Image> getImages() {
        return images;
    }

    public void setImages(List<Image> images) {
        this.images = images;
    }

    public boolean isImg() {
        return img;
    }

    public void setImg(boolean img) {
        this.img = img;
    }

    public HousCategorie getHousCategorie() {
        return housCategorie;
    }

    public void setHousCategorie(HousCategorie housCategorie) {
        this.housCategorie = housCategorie;
    }

    public double getAmountValue() {
        return amountValue;
    }

    public void setAmountValue(double amountValue) {
        this.amountValue = amountValue;
    }

    public int getSizeValue() {
        return sizeValue;
    }

    public void setSizeValue(int sizeValue) {
        this.sizeValue = sizeValue;
    }

}
